package learningThread.api.isAliveApi;



/**
 *  isAlive 测试线程存活，线程已经启动且尚未终止，处于运行或者准备状态(调用start方法之后) 就认为线程是存活的
 */
public class TestAliveThread {

    public static void main(String[] args) throws Exception{
        //继承Thread
        MyThread myThread = new MyThread();

        myThread.start();
        Thread.sleep(1000);
        System.out.println("线程是否存活:"+ myThread.isAlive());
    }
}
